<?php if (isset($notice) || $notice = $this->session->flashdata('notification')):?>
<p class="notice"><?php echo $notice;?></p>
<?php endif;?>

<h1><?php echo __("Contabilit&agrave missione", $module) ?></h1>
<form method='post' action='<?php echo site_url('adozioni/contabilita/missioni/contabilita') ?>'>

<label for="id_rimessa">Missione :
<select name="id_missione">
<?php foreach($missioni as $r): ?>
<option value="<?php echo $r['id'] ?>" <?php if(isset($id_missione) && $id_missione == $r['id']) echo "selected"; ?>><?php echo $r['nome'] ?></option>
<?php endforeach; ?>
</select></label>

<label for="anno"><?php echo __("Anno", $module) ?></label>
<select name="anno">
<?php foreach($anni as $a): ?>
<option value="<?php echo $a['anno'] ?>" <?php if($a['anno'] == $anno) echo " selected "; ?>><?php echo $a['anno']; ?></option>
<?php endforeach; ?>
</select>
<input type="submit" name="go" value="  Visualizza  "/>

</form>

<h1>Report Missioni</h1>
<form method='post' action='<?php echo site_url('adozioni/contabilita/missioni/rimesse') ?>'>
<label for="id_rimessa">Rimessa :
<select name="id_rimessa">
<?php foreach($rimesse as $r): ?>
<option value="<?php echo $r['id'] ?>" <?php if(isset($id_rimessa) && $id_rimessa == $r['id']) echo "selected"; ?>><?php echo $r['nome'] ?></option>
<?php endforeach; ?>
</select></label>

<label for="id_categoria"><?php echo __("Categoria:", $module) ?>
<select name="id_categoria"><option value=''>Tutte</option>
<?php foreach($categorie as $r): ?>
<option value="<?php echo $r['id'] ?>" <?php if(isset($id_categoria) && $id_categoria == $r['id']) echo "selected"; ?>><?php echo $r['nome'] ?></option>
<?php endforeach; ?>
</select></label>

<label for="anno"><?php echo __("Anno", $module) ?></label>
<select name="anno">
<?php foreach($anni as $a): ?>
<option value="<?php echo $a['anno'] ?>" <?php if($a['anno'] == $anno) echo " selected "; ?>><?php echo $a['anno']; ?></option>
<?php endforeach; ?>
</select>

<label for="mese" style="background-color: #EEEEEE;">  <?php echo __("Mese:", $module) ?>
<select name="mese" id="mese">
<?php for($i = 1; $i <= 12; $i++): ?>
<option value="<?php echo $i; ?>" ><?php echo $nome_mese[$i] ?></option>
<?php endfor; ?>
</select>
</label>


<label for="excel">Excel <input type="checkbox" name="excel" value="1" /></label> 
<input type="submit" name="go" value="  Visualizza  "/>


</form>


<script type="text/javascript">
$(document).ready(function(){
	$("#tutto").click(function(){
        
		if($(this).attr('checked') == false)
        {
            $(this).parents('form').find("input[name*='mese']").attr('checked', false);
        }
        else
        {
            $(this).parents('form').find("input[name*='mese']").attr('checked', true);
        }
	});
});
</script>
<h1><?php echo __("Report missioni tutte le categorie e missioni", $module) ?></h1>




<form id="form1" method='post' action='<?php echo site_url('adozioni/contabilita/missioni/tutti') ?>'>

<label for="anno"><?php echo __("Anno : ", $module) ?>
<input type="text" name="anno" value="<?php echo $anno ?>" />
</label>

<label for="mese" style="background-color: #EEEEEE;"> 
<select name="mese" id="mese">
<?php for($i = 1; $i <= 12; $i++): ?>
<option value="<?php echo $i; ?>"><?php echo $nome_mese[$i] ?></option>
<?php endfor; ?>
</select>
</label>
<?php /*
<br />
<label for="id_rimesse">Rimessa :
<select name="id_rimesse"><option></option>
<?php foreach($rimesse as $r): ?>
<option value="<?php echo $r['id'] ?>" <?php if(isset($id_rimesse) && $id_rimesse == $r['id']) echo "selected"; ?>><?php echo $r['nome'] ?></option>
<?php endforeach; ?>
</select></label>
*/ ?>
<label for="excel">Excel <input type="checkbox" name="excel" value="1" /></label> 
<input type="submit" name="go" value="  Visualizza  "/>



</form>


	<form id="form2" method='post' action='<?php echo site_url('adozioni/contabilita/missioni/annuali') ?>'>

<h1><?php echo __("Report Missioni Annuali", $module) ?></h1>
<label for="anno"><?php echo __("Anno : ", $module) ?>
<input type="text" name="anno" value="<?php echo $anno ?>" />
</label>
<label for="tutto"><input type="checkbox" id="tutto" />Seleziona Tutto</label>
<?php for($i = 0; $i < 12; $i++): ?>
<label for="mese[<?php echo $i; ?>]" style="background-color: #EEEEEE;"> <input type="checkbox" id="mese[<?php echo $i; ?>]" name="mese[<?php echo $i; ?>]" value="<?php echo $i+1; ?>"  /><?php echo $nome_mese[$i+1] ?></label>
<?php endfor; ?>
<br />
<label for="id_rimesse">Rimessa :
<select name="id_rimesse"><option></option>
<?php foreach($rimesse as $r): ?>
<option value="<?php echo $r['id'] ?>" <?php if(isset($id_rimesse) && $id_rimesse == $r['id']) echo "selected"; ?>><?php echo $r['nome'] ?></option>
<?php endforeach; ?>
</select></label>
<label for="excel">Excel <input type="checkbox" name="excel" value="1" /></label> 
<label for="subcat">Visualizza Sottocategorie <input type="checkbox" name="subcat" value="1" /></label> 
<input type="submit" name="go" value="  Visualizza  "/>


</form>

